package org.amphiprion.apiforanywebsite.model;

import org.amphiprion.apiforanywebsite.annotation.WebElement;

public class WeatherRow {
	@WebElement(cssSelector = "h3[class=wx-time]")
	private int time;

	@WebElement(cssSelector = "h3[class=wx-time] span")
	private String day;

	@WebElement(cssSelector = "p[class=wx-phrase]")
	private String weather;

	@WebElement(cssSelector = "div[class=wx-details] dl:nth-child(1) dd")
	private String temp;

	@WebElement(cssSelector = "div[class=wx-details] dl:nth-child(2) dd")
	private String humidity;

	@WebElement(cssSelector = "div[class=wx-details] dl:nth-child(3) dd")
	private String pctRain;

	private String windSpeed;
	private String windDirection;

	@WebElement(cssSelector = "div[class=wx-details] dl:nth-child(4) dd")
	public void setWind(String wind) {
		String[] strs = wind.split(" ");
		windDirection = strs[0];
		windSpeed = strs[2];
	}

	@Override
	public String toString() {
		return day + " | " + time + " | " + weather + " | " + temp + " | " + humidity + " | " + pctRain + " | " + windSpeed + " / " + windDirection;
	}
}
